<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <div id="app">
    改变a属性
    <input type="text" v-model="obj.a">
    <button @click="arr.push(1)">增加数组</button>
    <button @click="arr[0] = 11111">改变数组第一个</button>
  </div>
  <script src="./vue.js"></script>
  <script>
    const vm = new Vue({
      el: '#app',
      data: {
       obj: {
         a: 'a',
         b: 'b'
       },
       arr: [1,2,3,4,5]
      },
      watch: {
        obj(newVal){
          console.log('obj改变了值是', obj);
        },
        arr(newVal){
          console.log('arr改变了', newVal);
        }
      }
    })
  </script>
</body>
</html>